Skip to content

add score_genes support for Dask#408

Merged
Intron7 merged 4 commits into
mainfrom
score_genes_dask
Jul 29, 2025
Merged

add score_genes support for Dask#408
Intron7 merged 4 commits into
mainfrom
score_genes_dask

Conversation

@Intron7
Copy link
Copy Markdown
Member

@Intron7 Intron7 commented Jul 17, 2025

No description provided.

@Intron7 Intron7 linked an issue Jul 17, 2025 that may be closed by this pull request
@Intron7 Intron7 requested a review from flying-sheep July 17, 2025 11:29
Copy link
Copy Markdown
Member

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! I think csc support would be very easy and a few minor simplifications possible, otherwise great!

Comment thread src/rapids_singlecell/get/_anndata.py Outdated
Comment on lines +94 to +97
if isinstance(X._meta, csc_matrix_cpu):
pass
meta = _meta_sparse if isinstance(X._meta, csr_matrix_cpu) else _meta_dense
X = X.map_blocks(X_to_GPU, meta=meta(X.dtype))
elif isinstance(X._meta, csr_matrix_gpu) or isinstance(X._meta, cp.ndarray):
pass
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if isinstance(X._meta, csc_matrix_cpu):
pass
meta = _meta_sparse if isinstance(X._meta, csr_matrix_cpu) else _meta_dense
X = X.map_blocks(X_to_GPU, meta=meta(X.dtype))
elif isinstance(X._meta, csr_matrix_gpu) or isinstance(X._meta, cp.ndarray):
pass
if isinstance(X._meta, csc_matrix_cpu | csr_matrix_gpu | cp.ndarray):
pass

Comment on lines -168 to +165
return cp.vstack([mean, var])
return cp.stack([mean, var], axis=1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m curious: why the axis switch? is this more local?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works the other for some reason doesn't

Comment thread src/rapids_singlecell/tools/_utils.py
@Intron7
Copy link
Copy Markdown
Member Author

Intron7 commented Jul 27, 2025

I have csc support for non dask arrays. But for the moment I don't support dask csc in general also because of cupy being weird about it.

@Intron7 Intron7 enabled auto-merge (squash) July 29, 2025 15:40
@Intron7 Intron7 merged commit d6d55ac into main Jul 29, 2025
13 of 16 checks passed
@Intron7 Intron7 deleted the score_genes_dask branch July 29, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEA] Dask Support for tl.score_genes

2 participants